//- 先去这个pug文件中找
extends ../commons/commons.pug

block append pageStyle
	link(href="${relativePath}/static/css/shopping/tjOrder.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/personCenter/myPj.css" rel="stylesheet" type="text/css")
block content
	//- 提交订单内容
	div.placeOrderCon.layout
		//- logo部分
		div.submitHeader
			div.logo.fl
				img(src="${relativePath}/static/imgs/shopin.png")
		//- 评价内容
		div.pjComment
			span.topTitle 评价
			div.contentLeftOne
				//- img(src="${relativePath}/static/imgs/clList.png")
				//- p.title 超薄LED灯箱双面灯箱
				//- ul
				//- 	li 字壳材质厚度：0.5mm
				//- 	li 字壳材质厚度：0.5mm
				//- 	li 字壳材质厚度：0.5mm
				//- 	li 字壳材质厚度：0.5mm
			div.contentRight
				div.starBox
					ul.stars
						li
							img(src="${relativePath}/static/imgs/star1.png")
						li
							img(src="${relativePath}/static/imgs/star1.png")
						li
							img(src="${relativePath}/static/imgs/star1.png")
						li
							img(src="${relativePath}/static/imgs/star1.png")
						li
							img(src="${relativePath}/static/imgs/star1.png")
				div.plContent
					textarea(max="500" placeholder="输入评论内容" readonly="readonly")
				//- 上传图片
				div.pjUpimg
					div.imgLeft.fl
						div.upImgBox
							div.upLoad
								input(type="hidden",name="order_img")
								div#fileUploadContent.fileUploadContent.fl
									form#uploadForm
										div.upimg-div.clear
											section.z_file.fl
												//- img.lookImg(src="http://cdnimg1.biaoshi360.cn/order/2018/0227/5a950ddcea759.png")
					div.rightPj.current.fr 匿名评论
					input.score(type="hidden" name="score" value="5")
			div.clear
	script#pjShop(type="text/html")
		| {{set goods = data.goods}}
		img(src="{{goods.img}}")
		p.title {{goods.goods_name}}
		| {{set lists = goods.sku_list}}
		ul
			| {{each lists arr}}
			li {{arr.spec_name}}：{{arr.opt_name}}
			| {{/each}}
block append pageScript

	script.
		$(function() {
			$.get(shopIp+"/Comment/commentInfo?userToken="+token+"&order_id="+thisRequest.order_id,function(data) {
				//console.log(data);
				$(".plContent textarea").html(data.data.contents);
				var imgs = data.data.comment_imgs;
				for(var i=0;i<imgs.length;i++) {
					var imgEle = "<img class='lookImg' src='"+imgs[i]+"' style='width:100px'/>";
					$(".z_file").append(imgEle);
				}
				if(data.data.score == "1") {
					$(".stars li:lt(1) img").attr("src","${relativePath}/static/imgs/star2.png");
				}else if(data.data.score == "2") {
					$(".stars li:lt(2) img").attr("src","${relativePath}/static/imgs/star2.png");
				}else if(data.data.score == "3") {
					$(".stars li:lt(3) img").attr("src","${relativePath}/static/imgs/star2.png");
				}else if(data.data.score == "4") {
					$(".stars li:lt(4) img").attr("src","${relativePath}/static/imgs/star2.png");
				}else if(data.data.score == "5") {
					$(".stars li:lt(5) img").attr("src","${relativePath}/static/imgs/star2.png");
				}
			})
			
			//- 左边商品详情
			$.get(shopIp+"/Order/info?userToken="+token+"&order_id="+thisRequest.order_id+"&user_identity='buyer'",function(data) {
				var shopMsg = template("pjShop",data);
				//console.log(shopMsg);
				$(".contentLeftOne").append(shopMsg);
			})
			var anonymous;
			$(".rightPj").click(function() {
				if($(this).hasClass("current")) {
					$(this).removeClass("current");
					anonymous = 0;
				}else{
					$(this).addClass("current");
					anonymous = 1;
				}
			})
		})
		


		